Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix unhandled ResultSet.json errors, prepare 1.6.0 #311

Merged
merged 2 commits into from
Sep 12, 2024

Conversation

slvrtrn
Copy link
Contributor

@slvrtrn slvrtrn commented Sep 12, 2024

Summary

Resolves #309

Checklist

  • Unit and integration tests covering the common scenarios were added
  • A human-readable description of the changes was provided to include in CHANGELOG

@slvrtrn slvrtrn changed the title Fix unhandled ResultSet.json errors Fix unhandled ResultSet.json errors, prepare 1.6.0 Sep 12, 2024
@slvrtrn slvrtrn requested a review from mshustov September 12, 2024 17:43
Copy link

}
})
stream.on('end', resolve)
stream.on('error', reject)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not needed?

Copy link
Contributor Author

@slvrtrn slvrtrn Sep 12, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the exact part that produced unhandled exceptions.

for await (const rows of stream) {
  for (const row of rows) {
    result.push(row.json())
  }
}

achieves the same on the modern Node.js versions, but we can catch the error properly on the app side.

@slvrtrn slvrtrn merged commit fa85613 into main Sep 12, 2024
25 checks passed
@slvrtrn slvrtrn deleted the fix-unhandled-result-set-errors branch September 12, 2024 18:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Uncatchable parse errors when incoming data is not a valid JSON
2 participants